package com.ruoyi.teaching.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.teaching.domain.PlatformQKnowledge;
import com.ruoyi.teaching.domain.vo.PlatformQKnowledgeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 王旭
 * @since 2024-06-11
 */
@Mapper
public interface PlatformQKnowledgeMapper extends BaseMapper<PlatformQKnowledge> {

    List<Integer> selectKnowledgeIdByName(String knowledgeName);

    List<PlatformQKnowledgeVO> selectKnowledgeListBySpecialtyId(@Param("deptIds") Long[] deptIds);

    List<PlatformQKnowledgeVO> selectKnowledgeIdByCreateId(int i);

    @Select("SELECT * FROM platform_q_knowledge WHERE knowledge_name = #{knowledgeName} AND specialty_id = #{specialtyId} LIMIT 1")
    PlatformQKnowledge selectByNameAndSpecialty(@Param("knowledgeName") String knowledgeName,@Param("specialtyId") Integer specialtyId);
}
